package com.xugui.learn.user.controller;

import com.xugui.learn.user.pojo.request.UserAddRequest;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.*;

@Tag(name = "用户管理", description = "用户管理接口")
@RestController
@RequestMapping("/user")
public class UserController {

    /**
     * 添加用户
     *
     * @param userAddRequest 添加用户请求参数
     */
    @PostMapping("/add")
    @Operation(summary = "添加用户", description = "添加一个新用户")
    public void addUser(
            @Parameter(description = "添加用户请求参数", example = "用户添加请求参数示例")
            @Valid @RequestBody UserAddRequest userAddRequest,

            @Parameter(description = "用户年龄", example = "18")
            @RequestParam(defaultValue = "18") Integer age
    ) {

    }

}
